package site.codeyin.javautils.utils.mapstruct.spring;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import site.codeyin.javautils.utils.mapstruct.pojo.MapStructData;
import site.codeyin.javautils.utils.mapstruct.pojo.MapStructVO;

@Mapper(componentModel = "spring")
public interface MapStructConvertor {
    @Mappings({
            @Mapping(source = "date", target = "dateTime"),
            @Mapping(target = "longDate",expression = "java(mapStructData.getLongDate().getTime())"),
    })
    MapStructVO toMapStructVO(MapStructData mapStructData);
}